package com.kupurui.asteacher.adapter;

import android.content.Context;
import android.widget.TextView;

import com.android.frame.adapter.CommonAdapter;
import com.android.frame.adapter.ViewHolder;
import com.kupurui.asteacher.R;

import java.util.List;

/**
 * Created by pmj on 2017/5/10.
 */

public class ScreenRuleAdapter extends CommonAdapter<String> {

    private int chooseIndex = -1;

    public ScreenRuleAdapter(Context context, List<String> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
    }

    @Override
    public void convert(ViewHolder holder, String item, int positon) {
        TextView tvContent = holder.getView(R.id.tv_content);
        if (chooseIndex == positon) {
            tvContent.setTextColor(mContext.getResources().getColor(R.color.tab_color));
        } else {
            tvContent.setTextColor(mContext.getResources().getColor(R.color.text_black));
        }
        tvContent.setText(item);
    }

    public int getChooseIndex() {
        return chooseIndex;
    }

    public void setChooseIndex(int chooseIndex) {
        this.chooseIndex = chooseIndex;
    }
}
